// Upgrade NOTE: commented out 'float4x4 _World2Object', a built-in variable
// Upgrade NOTE: commented out 'sampler2D unity_Lightmap', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced tex2D unity_Lightmap with UNITY_SAMPLE_TEX2D

Shader "Legacy Shaders/Reflective/VertexLit" {
Properties {
 _Color ("Main Color", Color) = (1,1,1,1)
 _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
 _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" { }
 _Cube ("Reflection Cubemap", CUBE) = "_Skybox" { }
}
SubShader { 
 LOD 150
 Tags { "RenderType"="Opaque" }
 Pass {
  Name "BASE"
  Tags { "LIGHTMODE"="Always" "RenderType"="Opaque" }
  GpuProgramID 6413
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float3 _WorldSpaceCameraPos;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
uniform samplerCUBE _Cube;
uniform float4 _ReflectColor;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 v_1;
    v_1.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_1.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_1.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_1.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_2;
    v_2.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_2.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_2.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_2.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_3;
    v_3.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_3.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_3.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_3.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_4;
    tmpvar_4 = normalize((((v_1.xyz * in_v.normal.x) + (v_2.xyz * in_v.normal.y)) + (v_3.xyz * in_v.normal.z)));
    float3 I_5;
    I_5 = (mul(unity_ObjectToWorld, in_v.vertex).xyz - _WorldSpaceCameraPos);
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_TEXCOORD1 = (I_5 - (2 * (dot(tmpvar_4, I_5) * tmpvar_4)));
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 col_1;
    col_1.xyz = ((texCUBE(_Cube, in_f.xlv_TEXCOORD1) * tex2D(_MainTex, in_f.xlv_TEXCOORD0).w) * _ReflectColor).xyz;
    col_1.w = 1;
    out_f.color = col_1;
    return out_f;
}


ENDCG

}
 Pass {
  Tags { "LIGHTMODE"="Vertex" "RenderType"="Opaque" }
  Lighting On
  ZWrite Off
  Blend One One
  GpuProgramID 70332
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4 unity_LightAtten[8];
//uniform float4 unity_SpotDirection[8];
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 UNITY_MATRIX_MV;
//uniform float4x4 UNITY_MATRIX_IT_MV;
//uniform float4 glstate_lightmodel_ambient;
uniform float4 _MainTex_ST;
uniform float4 _Color;
uniform float4 _ReflectColor;
uniform sampler2D _MainTex;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_COLOR0 :COLOR0;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float4 xlv_COLOR0 :COLOR0;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float3 lightColor_2;
    float3 viewN_3;
    float3 viewpos_4;
    viewpos_4 = UnityObjectToViewPos(in_v.vertex).xyz;
    float3x3 tmpvar_5;
    tmpvar_5[0] = conv_mxt4x4_0(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_5[1] = conv_mxt4x4_1(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_5[2] = conv_mxt4x4_2(UNITY_MATRIX_IT_MV).xyz;
    viewN_3 = normalize(mul(tmpvar_5, in_v.normal));
    float3 tmpvar_6;
    tmpvar_6 = (glstate_lightmodel_ambient * 2).xyz;
    lightColor_2 = tmpvar_6;
    float3 toLight_7;
    float3 tmpvar_8;
    tmpvar_8 = (unity_LightPosition[0].xyz - (viewpos_4 * unity_LightPosition[0].w));
    float tmpvar_9;
    tmpvar_9 = dot(tmpvar_8, tmpvar_8);
    toLight_7 = (tmpvar_8 * rsqrt(tmpvar_9));
    lightColor_2 = (lightColor_2 + (unity_LightColor[0].xyz * (max(0, dot(viewN_3, toLight_7)) * ((1 / (1 + (tmpvar_9 * unity_LightAtten[0].z))) * clamp(((max(0, dot(toLight_7, unity_SpotDirection[0].xyz)) - unity_LightAtten[0].x) * unity_LightAtten[0].y), 0, 1)))));
    float3 toLight_10;
    float3 tmpvar_11;
    tmpvar_11 = (unity_LightPosition[1].xyz - (viewpos_4 * unity_LightPosition[1].w));
    float tmpvar_12;
    tmpvar_12 = dot(tmpvar_11, tmpvar_11);
    toLight_10 = (tmpvar_11 * rsqrt(tmpvar_12));
    lightColor_2 = (lightColor_2 + (unity_LightColor[1].xyz * (max(0, dot(viewN_3, toLight_10)) * ((1 / (1 + (tmpvar_12 * unity_LightAtten[1].z))) * clamp(((max(0, dot(toLight_10, unity_SpotDirection[1].xyz)) - unity_LightAtten[1].x) * unity_LightAtten[1].y), 0, 1)))));
    float3 toLight_13;
    float3 tmpvar_14;
    tmpvar_14 = (unity_LightPosition[2].xyz - (viewpos_4 * unity_LightPosition[2].w));
    float tmpvar_15;
    tmpvar_15 = dot(tmpvar_14, tmpvar_14);
    toLight_13 = (tmpvar_14 * rsqrt(tmpvar_15));
    lightColor_2 = (lightColor_2 + (unity_LightColor[2].xyz * (max(0, dot(viewN_3, toLight_13)) * ((1 / (1 + (tmpvar_15 * unity_LightAtten[2].z))) * clamp(((max(0, dot(toLight_13, unity_SpotDirection[2].xyz)) - unity_LightAtten[2].x) * unity_LightAtten[2].y), 0, 1)))));
    float3 toLight_16;
    float3 tmpvar_17;
    tmpvar_17 = (unity_LightPosition[3].xyz - (viewpos_4 * unity_LightPosition[3].w));
    float tmpvar_18;
    tmpvar_18 = dot(tmpvar_17, tmpvar_17);
    toLight_16 = (tmpvar_17 * rsqrt(tmpvar_18));
    lightColor_2 = (lightColor_2 + (unity_LightColor[3].xyz * (max(0, dot(viewN_3, toLight_16)) * ((1 / (1 + (tmpvar_18 * unity_LightAtten[3].z))) * clamp(((max(0, dot(toLight_16, unity_SpotDirection[3].xyz)) - unity_LightAtten[3].x) * unity_LightAtten[3].y), 0, 1)))));
    float4 tmpvar_19;
    tmpvar_19.xyz = float3(lightColor_2);
    tmpvar_19.w = _ReflectColor.w;
    tmpvar_1 = (tmpvar_19 * _Color);
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_COLOR0 = tmpvar_1;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 c_1;
    c_1.xyz = (tex2D(_MainTex, in_f.xlv_TEXCOORD0).xyz * in_f.xlv_COLOR0.xyz);
    c_1.w = 1;
    out_f.color = c_1;
    return out_f;
}


ENDCG

}
 Pass {
  Tags { "LIGHTMODE"="VertexLM" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  ColorMask RGB
  GpuProgramID 149264
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
uniform float4 _MainTex_ST;
uniform float4x4 unity_LightmapMatrix;
// uniform sampler2D unity_Lightmap;
uniform sampler2D _MainTex;
uniform float4 _Color;
struct appdata_t
{
    float4 vertex :POSITION;
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float2 tmpvar_1;
    float2 tmpvar_2;
    tmpvar_1 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    float4 tmpvar_3;
    tmpvar_3.zw = float2(0, 1);
    tmpvar_3.xy = in_v.texcoord1.xy;
    tmpvar_2 = mul(unity_LightmapMatrix, tmpvar_3).xy;
    out_v.xlv_TEXCOORD0 = tmpvar_1;
    out_v.xlv_TEXCOORD1 = tmpvar_2;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 c_1;
    c_1.xyz = (tex2D(_MainTex, in_f.xlv_TEXCOORD0).xyz * ((UNITY_SAMPLE_TEX2D(unity_Lightmap, in_f.xlv_TEXCOORD1) * _Color).xyz * 2));
    c_1.w = 1;
    out_f.color = c_1;
    return out_f;
}


ENDCG

}
 Pass {
  Tags { "LIGHTMODE"="VertexLMRGBM" "RenderType"="Opaque" }
  ZWrite Off
  Blend One One
  ColorMask RGB
  GpuProgramID 212321
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
uniform float4 _MainTex_ST;
uniform float4x4 unity_LightmapMatrix;
// uniform sampler2D unity_Lightmap;
uniform sampler2D _MainTex;
uniform float4 _Color;
struct appdata_t
{
    float4 vertex :POSITION;
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float2 tmpvar_1;
    float2 tmpvar_2;
    tmpvar_1 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    float4 tmpvar_3;
    tmpvar_3.zw = float2(0, 1);
    tmpvar_3.xy = in_v.texcoord1.xy;
    tmpvar_2 = mul(unity_LightmapMatrix, tmpvar_3).xy;
    out_v.xlv_TEXCOORD0 = tmpvar_1;
    out_v.xlv_TEXCOORD1 = tmpvar_2;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 c_1;
    float4 lm_2;
    float4 tmpvar_3;
    tmpvar_3 = UNITY_SAMPLE_TEX2D(unity_Lightmap, in_f.xlv_TEXCOORD1);
    lm_2 = (tmpvar_3 * (tmpvar_3.w * 2));
    lm_2 = (lm_2 * _Color);
    c_1.xyz = (tex2D(_MainTex, in_f.xlv_TEXCOORD0).xyz * (lm_2.xyz * 4));
    c_1.w = 1;
    out_f.color = c_1;
    return out_f;
}


ENDCG

}
}
Fallback "Legacy Shaders/VertexLit"
}